﻿using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using DXTools.UI.Modules.JavaScriptConverter.ViewModels;
using DXTools.UI.Core.View;
using DXTools.UI.Core;

using Microsoft.Practices.Prism.Regions;
using Microsoft.Practices.Prism.Events;
using Microsoft.Practices.Prism.Commands;
using Microsoft.Practices.Unity;
using DXTools.UI.Modules.JavaScriptConverter.Views;
using DXTools.UI.Core.Events;
using DXTools.UI.Core.ViewModel;

namespace DXTools.UI.Modules.JavaScriptConverter.Views
{
    public partial class JSConverterView : ViewBase
    {
        public JSConverterView(JSConverterViewModel viewModel)
            : base(viewModel)
        {
            InitializeComponent();
            this.DataContext = viewModel;
        }

        

        //private void ConvertScript(object sender, RoutedEventArgs e)
        //{
        //    string viewName = Convert.ToString(((HyperlinkButton)e.OriginalSource).Content);
        //    IRegion bodyRegion = ((EntitiesViewModel)this.DataContext).RegionManager.Regions[RegionNames.BODY_REGION];
        //    object view = bodyRegion.GetView(viewName);
        //    if (view == null)
        //    {

        //        EntityView newView = ((EntitiesViewModel)this.DataContext).UnityContainer.Resolve<EntityView>();
        //        bodyRegion.Add(newView, viewName);
        //        bodyRegion.Activate(newView);
        //        ((EntitiesViewModel)this.DataContext).EventAggregator.GetEvent<ViewAddedEvent>().Publish(newView);
        //        newView.SetEntityName(viewName);
        //    }
        //    else
        //        bodyRegion.Activate(view);

        //}

    }
}
